#include <string>
#include <iostream>
#include <sstream>
#include <SRL/Utils/Core.h> 

namespace srl {
    
    // Constructor with out type
    Log::Log() { } // std::cout = std::cout; }
    Log::~Log() { }
    
	/************** Log Types ***********/
    
    #ifdef SRL_DebugMode
    
		Log Log::Info() {
			__Singleton()->operator<<("[Info]       ");
			return *__Singleton();
		}
		Log Log::Warning() {
			__Singleton()->operator<<("[Warning]    ");
			return *__Singleton();
		}
		Log Log::Error() {
			__Singleton()->operator<<("[Error]      ");
			return *__Singleton();
		}
		
    #else
    
    	Log Log::Info() {}
		Log Log::Warning() {}
		Log Log::Error() {}
		
    #endif
    
    
    /************* Operators ************/
    // Write a string
    Log& Log::operator<<(std::string str) {
        std::cout << str;
        return (*this); 
    }
    Log& Log::operator<<(char* str) {
    	std::cout << str;
        return (*this);
    }
    
    // Write numbers
    Log& Log::operator<<(int i) {
        std::cout << i;
        return (*this);
    }
    Log& Log::operator<<(float f) {
        std::cout << f;
        return (*this);
    }
    Log& Log::operator<<(double d) {
        std::cout << d;
        return (*this); 
    }
    
    // Write SRL types
    Log& Log::operator<<(srl::Vector<float> v) {
    	std::cout << v.x << " ; " << v.y << " ; " << v.z;
        return (*this);
    }
    
    
    
    
    
    
    
    // SRL Exception
    std::string Exception::GetString() {
		std::stringstream ss;
		ss << std::endl;
		ss << "[Error] In File \"" << mFile << "\"  [" << mLine << "]\n";
		ss << "In function : \"" << mFunc << "\"\n";
		ss << mDesc;
		return ss.str();
	}
};
